<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			
			console.log(document.readyState); // loading 还没有完成
			
			window.onload = function()
			{
				console.log(document.readyState); // complete 完成
				// document.body 访问body元素
				document.body.style.background = "#000000"; 
				
				var i=0;
				// setInterval(定时要执行的代码,间隔时间)
				setInterval(function(){
					var r = Math.floor(Math.random()*256);
					var g = Math.floor(Math.random()*256);
					var b = Math.floor(Math.random()*256);
					document.body.style.background = "rgb("+r+","+g+","+b+")";// rgb(255,0,0)
					
					// 修改网页的标题
					if(i==0)
					{
						i=1;
						document.title = "(∩_∩)O哈哈~"
					}
					else
					{
						i=0;
						document.title = "O(∩_∩)嘿嘿~"
					}
					
				},1000);
				
				console.log(document.URL);
				console.log(document.domain);
				console.log(document.referrer);
				
				

			}
		</script>
	</body>
</html>
